﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVOHDBan
    {
        private int _MaHDBan;
        private int _MaNV;
        private int _MaKH;
        private DateTime _NgayLap;

        public UserVOHDBan(int MaHDBan,int MaNV, int MaKH, DateTime Ngaylap)
        {
            this._MaHDBan = MaHDBan;
            this._MaNV = MaNV;
            this._MaKH = MaKH;
            this._NgayLap = Ngaylap;          
        }

        public int MAHOADONBAN
        {
            get { return _MaHDBan; }
            set { _MaHDBan = value; }
        }

        public DateTime NGAYLAP
        {
            get { return _NgayLap; }
            set { _NgayLap = value; }
        }

        public int MANHANVIEN
        {
            get { return _MaNV; }
            set { _MaNV = value; }
        }

        public int MAKHACHHANG
        {
            get { return _MaKH; }
            set { _MaKH = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaHDBan = dr.IsNull(0) ? 0 : Convert.ToInt32(dr[0]);
                this._MaNV = dr.IsNull(1) ? 0 : Convert.ToInt32(dr[1]);
                this._MaKH = dr.IsNull(2) ? 0 : Convert.ToInt32(dr[2]);
                this._NgayLap = dr.IsNull(3) ? DateTime.Now : Convert.ToDateTime(dr[3]);
            }
        }
    }
}